home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / Clueless.swf / scripts / caurina / transitions / Tweener.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  37.5 KB  |  1,091 lines

  1. package caurina.transitions
  2. {
  3.    import flash.display.*;
  4.    import flash.events.Event;
  5.    import flash.utils.getTimer;
  6.    
  7.    public class Tweener
  8.    {
  9.       
  10.       private static var _timeScale:Number = 1;
  11.       
  12.       private static var _currentTimeFrame:Number;
  13.       
  14.       private static var _specialPropertySplitterList:Object;
  15.       
  16.       private static var _engineExists:Boolean = false;
  17.       
  18.       private static var _specialPropertyModifierList:Object;
  19.       
  20.       private static var _currentTime:Number;
  21.       
  22.       private static var _tweenList:Array;
  23.       
  24.       private static var _specialPropertyList:Object;
  25.       
  26.       private static var _transitionList:Object;
  27.       
  28.       private static var _inited:Boolean = false;
  29.       
  30.       private static var __tweener_controller__:MovieClip;
  31.        
  32.       
  33.       public function Tweener()
  34.       {
  35.          super();
  36.          trace("Tweener is a static class and should not be instantiated.");
  37.       }
  38.       
  39.       public static function registerSpecialPropertyModifier(param1:String, param2:Function, param3:Function) : void
  40.       {
  41.          var _loc4_:SpecialPropertyModifier = null;
  42.          if(!_inited)
  43.          {
  44.             init();
  45.          }
  46.          _loc4_ = new SpecialPropertyModifier(param2,param3);
  47.          _specialPropertyModifierList[param1] = _loc4_;
  48.       }
  49.       
  50.       public static function registerSpecialProperty(param1:String, param2:Function, param3:Function, param4:Array = null, param5:Function = null) : void
  51.       {
  52.          var _loc6_:SpecialProperty = null;
  53.          if(!_inited)
  54.          {
  55.             init();
  56.          }
  57.          _loc6_ = new SpecialProperty(param2,param3,param4,param5);
  58.          _specialPropertyList[param1] = _loc6_;
  59.       }
  60.       
  61.       public static function init(... rest) : void
  62.       {
  63.          _inited = true;
  64.          _transitionList = new Object();
  65.          Equations.init();
  66.          _specialPropertyList = new Object();
  67.          _specialPropertyModifierList = new Object();
  68.          _specialPropertySplitterList = new Object();
  69.       }
  70.       
  71.       private static function updateTweens() : Boolean
  72.       {
  73.          var _loc1_:int = 0;
  74.          if(_tweenList.length == 0)
  75.          {
  76.             return false;
  77.          }
  78.          _loc1_ = 0;
  79.          while(_loc1_ < _tweenList.length)
  80.          {
  81.             if(_tweenList[_loc1_] == undefined || !_tweenList[_loc1_].isPaused)
  82.             {
  83.                if(!updateTweenByIndex(_loc1_))
  84.                {
  85.                   removeTweenByIndex(_loc1_);
  86.                }
  87.                if(_tweenList[_loc1_] == null)
  88.                {
  89.                   removeTweenByIndex(_loc1_,true);
  90.                   _loc1_--;
  91.                }
  92.             }
  93.             _loc1_++;
  94.          }
  95.          return true;
  96.       }
  97.       
  98.       public static function addCaller(param1:Object = null, param2:Object = null) : Boolean
  99.       {
  100.          var _loc3_:Number = NaN;
  101.          var _loc4_:Array = null;
  102.          var _loc5_:Object = null;
  103.          var _loc6_:Number = NaN;
  104.          var _loc7_:Number = NaN;
  105.          var _loc8_:Function = null;
  106.          var _loc9_:TweenListObj = null;
  107.          var _loc10_:Number = NaN;
  108.          var _loc11_:String = null;
  109.          if(!Boolean(param1))
  110.          {
  111.             return false;
  112.          }
  113.          if(param1 is Array)
  114.          {
  115.             _loc4_ = param1.concat();
  116.          }
  117.          else
  118.          {
  119.             _loc4_ = [param1];
  120.          }
  121.          _loc5_ = param2;
  122.          if(!_inited)
  123.          {
  124.             init();
  125.          }
  126.          if(!_engineExists || !Boolean(__tweener_controller__))
  127.          {
  128.             startEngine();
  129.          }
  130.          _loc6_ = isNaN(_loc5_.time) ? 0 : Number(_loc5_.time);
  131.          _loc7_ = isNaN(_loc5_.delay) ? 0 : Number(_loc5_.delay);
  132.          if(typeof _loc5_.transition == "string")
  133.          {
  134.             _loc11_ = String(_loc5_.transition.toLowerCase());
  135.             _loc8_ = _transitionList[_loc11_];
  136.          }
  137.          else
  138.          {
  139.             _loc8_ = _loc5_.transition;
  140.          }
  141.          if(!Boolean(_loc8_))
  142.          {
  143.             _loc8_ = _transitionList["easeoutexpo"];
  144.          }
  145.          _loc3_ = 0;
  146.          while(_loc3_ < _loc4_.length)
  147.          {
  148.             if(_loc5_.useFrames == true)
  149.             {
  150.                _loc9_ = new TweenListObj(_loc4_[_loc3_],_currentTimeFrame + _loc7_ / _timeScale,_currentTimeFrame + (_loc7_ + _loc6_) / _timeScale,true,_loc8_,_loc5_.transitionParams);
  151.             }
  152.             else
  153.             {
  154.                _loc9_ = new TweenListObj(_loc4_[_loc3_],_currentTime + _loc7_ * 1000 / _timeScale,_currentTime + (_loc7_ * 1000 + _loc6_ * 1000) / _timeScale,false,_loc8_,_loc5_.transitionParams);
  155.             }
  156.             _loc9_.properties = null;
  157.             _loc9_.onStart = _loc5_.onStart;
  158.             _loc9_.onUpdate = _loc5_.onUpdate;
  159.             _loc9_.onComplete = _loc5_.onComplete;
  160.             _loc9_.onOverwrite = _loc5_.onOverwrite;
  161.             _loc9_.onStartParams = _loc5_.onStartParams;
  162.             _loc9_.onUpdateParams = _loc5_.onUpdateParams;
  163.             _loc9_.onCompleteParams = _loc5_.onCompleteParams;
  164.             _loc9_.onOverwriteParams = _loc5_.onOverwriteParams;
  165.             _loc9_.onStartScope = _loc5_.onStartScope;
  166.             _loc9_.onUpdateScope = _loc5_.onUpdateScope;
  167.             _loc9_.onCompleteScope = _loc5_.onCompleteScope;
  168.             _loc9_.onOverwriteScope = _loc5_.onOverwriteScope;
  169.             _loc9_.onErrorScope = _loc5_.onErrorScope;
  170.             _loc9_.isCaller = true;
  171.             _loc9_.count = _loc5_.count;
  172.             _loc9_.waitFrames = _loc5_.waitFrames;
  173.             _tweenList.push(_loc9_);
  174.             if(_loc6_ == 0 && _loc7_ == 0)
  175.             {
  176.                _loc10_ = _tweenList.length - 1;
  177.                updateTweenByIndex(_loc10_);
  178.                removeTweenByIndex(_loc10_);
  179.             }
  180.             _loc3_++;
  181.          }
  182.          return true;
  183.       }
  184.       
  185.       public static function pauseAllTweens() : Boolean
  186.       {
  187.          var _loc1_:Boolean = false;
  188.          var _loc2_:uint = 0;
  189.          if(!Boolean(_tweenList))
  190.          {
  191.             return false;
  192.          }
  193.          _loc1_ = false;
  194.          _loc2_ = 0;
  195.          while(_loc2_ < _tweenList.length)
  196.          {
  197.             pauseTweenByIndex(_loc2_);
  198.             _loc1_ = true;
  199.             _loc2_++;
  200.          }
  201.          return _loc1_;
  202.       }
  203.       
  204.       public static function removeTweens(param1:Object, ... rest) : Boolean
  205.       {
  206.          var _loc3_:Array = null;
  207.          var _loc4_:uint = 0;
  208.          var _loc5_:SpecialPropertySplitter = null;
  209.          var _loc6_:Array = null;
  210.          var _loc7_:uint = 0;
  211.          _loc3_ = new Array();
  212.          _loc4_ = 0;
  213.          while(_loc4_ < rest.length)
  214.          {
  215.             if(typeof rest[_loc4_] == "string" && _loc3_.indexOf(rest[_loc4_]) == -1)
  216.             {
  217.                if(_specialPropertySplitterList[rest[_loc4_]])
  218.                {
  219.                   _loc6_ = (_loc5_ = _specialPropertySplitterList[rest[_loc4_]]).splitValues(param1,null);
  220.                   _loc7_ = 0;
  221.                   while(_loc7_ < _loc6_.length)
  222.                   {
  223.                      _loc3_.push(_loc6_[_loc7_].name);
  224.                      _loc7_++;
  225.                   }
  226.                }
  227.                else
  228.                {
  229.                   _loc3_.push(rest[_loc4_]);
  230.                }
  231.             }
  232.             _loc4_++;
  233.          }
  234.          return affectTweens(removeTweenByIndex,param1,_loc3_);
  235.       }
  236.       
  237.       public static function splitTweens(param1:Number, param2:Array) : uint
  238.       {
  239.          var _loc3_:TweenListObj = null;
  240.          var _loc4_:TweenListObj = null;
  241.          var _loc5_:uint = 0;
  242.          var _loc6_:String = null;
  243.          var _loc7_:Boolean = false;
  244.          _loc3_ = _tweenList[param1];
  245.          _loc4_ = _loc3_.clone(false);
  246.          _loc5_ = 0;
  247.          while(_loc5_ < param2.length)
  248.          {
  249.             _loc6_ = String(param2[_loc5_]);
  250.             if(Boolean(_loc3_.properties[_loc6_]))
  251.             {
  252.                _loc3_.properties[_loc6_] = undefined;
  253.                delete _loc3_.properties[_loc6_];
  254.             }
  255.             _loc5_++;
  256.          }
  257.          for(_loc6_ in _loc4_.properties)
  258.          {
  259.             _loc7_ = false;
  260.             _loc5_ = 0;
  261.             while(_loc5_ < param2.length)
  262.             {
  263.                if(param2[_loc5_] == _loc6_)
  264.                {
  265.                   _loc7_ = true;
  266.                   break;
  267.                }
  268.                _loc5_++;
  269.             }
  270.             if(!_loc7_)
  271.             {
  272.                _loc4_.properties[_loc6_] = undefined;
  273.                delete _loc4_.properties[_loc6_];
  274.             }
  275.          }
  276.          _tweenList.push(_loc4_);
  277.          return _tweenList.length - 1;
  278.       }
  279.       
  280.       public static function updateFrame() : void
  281.       {
  282.          ++_currentTimeFrame;
  283.       }
  284.       
  285.       public static function resumeTweenByIndex(param1:Number) : Boolean
  286.       {
  287.          var _loc2_:TweenListObj = null;
  288.          var _loc3_:Number = NaN;
  289.          _loc2_ = _tweenList[param1];
  290.          if(_loc2_ == null || !_loc2_.isPaused)
  291.          {
  292.             return false;
  293.          }
  294.          _loc3_ = getCurrentTweeningTime(_loc2_);
  295.          _loc2_.timeStart += _loc3_ - _loc2_.timePaused;
  296.          _loc2_.timeComplete += _loc3_ - _loc2_.timePaused;
  297.          _loc2_.timePaused = undefined;
  298.          _loc2_.isPaused = false;
  299.          return true;
  300.       }
  301.       
  302.       public static function getVersion() : String
  303.       {
  304.          return "AS3 1.31.74";
  305.       }
  306.       
  307.       public static function onEnterFrame(param1:Event) : void
  308.       {
  309.          var _loc2_:Boolean = false;
  310.          updateTime();
  311.          updateFrame();
  312.          _loc2_ = false;
  313.          _loc2_ = updateTweens();
  314.          if(!_loc2_)
  315.          {
  316.             stopEngine();
  317.          }
  318.       }
  319.       
  320.       public static function updateTime() : void
  321.       {
  322.          _currentTime = getTimer();
  323.       }
  324.       
  325.       private static function updateTweenByIndex(param1:Number) : Boolean
  326.       {
  327.          var tTweening:TweenListObj = null;
  328.          var isOver:Boolean = false;
  329.          var mustUpdate:Boolean = false;
  330.          var nv:Number = NaN;
  331.          var t:Number = NaN;
  332.          var b:Number = NaN;
  333.          var c:Number = NaN;
  334.          var d:Number = NaN;
  335.          var pName:String = null;
  336.          var eventScope:Object = null;
  337.          var tScope:Object = null;
  338.          var cTime:Number = NaN;
  339.          var tProperty:Object = null;
  340.          var pv:Number = NaN;
  341.          var i:Number = param1;
  342.          tTweening = _tweenList[i];
  343.          if(tTweening == null || !Boolean(tTweening.scope))
  344.          {
  345.             return false;
  346.          }
  347.          isOver = false;
  348.          cTime = getCurrentTweeningTime(tTweening);
  349.          if(cTime >= tTweening.timeStart)
  350.          {
  351.             tScope = tTweening.scope;
  352.             if(tTweening.isCaller)
  353.             {
  354.                do
  355.                {
  356.                   t = (tTweening.timeComplete - tTweening.timeStart) / tTweening.count * (tTweening.timesCalled + 1);
  357.                   b = tTweening.timeStart;
  358.                   c = tTweening.timeComplete - tTweening.timeStart;
  359.                   d = tTweening.timeComplete - tTweening.timeStart;
  360.                   nv = tTweening.transition(t,b,c,d);
  361.                   if(cTime >= nv)
  362.                   {
  363.                      if(Boolean(tTweening.onUpdate))
  364.                      {
  365.                         eventScope = Boolean(tTweening.onUpdateScope) ? tTweening.onUpdateScope : tScope;
  366.                         try
  367.                         {
  368.                            tTweening.onUpdate.apply(eventScope,tTweening.onUpdateParams);
  369.                         }
  370.                         catch(e1:Error)
  371.                         {
  372.                            handleError(tTweening,e1,"onUpdate");
  373.                         }
  374.                      }
  375.                      ++tTweening.timesCalled;
  376.                      if(tTweening.timesCalled >= tTweening.count)
  377.                      {
  378.                         isOver = true;
  379.                         break;
  380.                      }
  381.                      if(tTweening.waitFrames)
  382.                      {
  383.                         break;
  384.                      }
  385.                   }
  386.                }
  387.                while(cTime >= nv);
  388.                
  389.             }
  390.             else
  391.             {
  392.                mustUpdate = tTweening.skipUpdates < 1 || !tTweening.skipUpdates || tTweening.updatesSkipped >= tTweening.skipUpdates;
  393.                if(cTime >= tTweening.timeComplete)
  394.                {
  395.                   isOver = true;
  396.                   mustUpdate = true;
  397.                }
  398.                if(!tTweening.hasStarted)
  399.                {
  400.                   if(Boolean(tTweening.onStart))
  401.                   {
  402.                      eventScope = Boolean(tTweening.onStartScope) ? tTweening.onStartScope : tScope;
  403.                      try
  404.                      {
  405.                         tTweening.onStart.apply(eventScope,tTweening.onStartParams);
  406.                      }
  407.                      catch(e2:Error)
  408.                      {
  409.                         handleError(tTweening,e2,"onStart");
  410.                      }
  411.                   }
  412.                   for(pName in tTweening.properties)
  413.                   {
  414.                      if(tTweening.properties[pName].isSpecialProperty)
  415.                      {
  416.                         if(Boolean(_specialPropertyList[pName].preProcess))
  417.                         {
  418.                            tTweening.properties[pName].valueComplete = _specialPropertyList[pName].preProcess(tScope,_specialPropertyList[pName].parameters,tTweening.properties[pName].originalValueComplete,tTweening.properties[pName].extra);
  419.                         }
  420.                         pv = Number(_specialPropertyList[pName].getValue(tScope,_specialPropertyList[pName].parameters,tTweening.properties[pName].extra));
  421.                      }
  422.                      else
  423.                      {
  424.                         pv = Number(tScope[pName]);
  425.                      }
  426.                      tTweening.properties[pName].valueStart = isNaN(pv) ? tTweening.properties[pName].valueComplete : pv;
  427.                   }
  428.                   mustUpdate = true;
  429.                   tTweening.hasStarted = true;
  430.                }
  431.                if(mustUpdate)
  432.                {
  433.                   for(pName in tTweening.properties)
  434.                   {
  435.                      tProperty = tTweening.properties[pName];
  436.                      if(isOver)
  437.                      {
  438.                         nv = Number(tProperty.valueComplete);
  439.                      }
  440.                      else if(tProperty.hasModifier)
  441.                      {
  442.                         t = cTime - tTweening.timeStart;
  443.                         d = tTweening.timeComplete - tTweening.timeStart;
  444.                         nv = tTweening.transition(t,0,1,d,tTweening.transitionParams);
  445.                         nv = Number(tProperty.modifierFunction(tProperty.valueStart,tProperty.valueComplete,nv,tProperty.modifierParameters));
  446.                      }
  447.                      else
  448.                      {
  449.                         t = cTime - tTweening.timeStart;
  450.                         b = Number(tProperty.valueStart);
  451.                         c = tProperty.valueComplete - tProperty.valueStart;
  452.                         d = tTweening.timeComplete - tTweening.timeStart;
  453.                         nv = tTweening.transition(t,b,c,d,tTweening.transitionParams);
  454.                      }
  455.                      if(tTweening.rounded)
  456.                      {
  457.                         nv = Math.round(nv);
  458.                      }
  459.                      if(tProperty.isSpecialProperty)
  460.                      {
  461.                         _specialPropertyList[pName].setValue(tScope,nv,_specialPropertyList[pName].parameters,tTweening.properties[pName].extra);
  462.                      }
  463.                      else
  464.                      {
  465.                         tScope[pName] = nv;
  466.                      }
  467.                   }
  468.                   tTweening.updatesSkipped = 0;
  469.                   if(Boolean(tTweening.onUpdate))
  470.                   {
  471.                      eventScope = Boolean(tTweening.onUpdateScope) ? tTweening.onUpdateScope : tScope;
  472.                      try
  473.                      {
  474.                         tTweening.onUpdate.apply(eventScope,tTweening.onUpdateParams);
  475.                      }
  476.                      catch(e3:Error)
  477.                      {
  478.                         handleError(tTweening,e3,"onUpdate");
  479.                      }
  480.                   }
  481.                }
  482.                else
  483.                {
  484.                   ++tTweening.updatesSkipped;
  485.                }
  486.             }
  487.             if(isOver && Boolean(tTweening.onComplete))
  488.             {
  489.                eventScope = Boolean(tTweening.onCompleteScope) ? tTweening.onCompleteScope : tScope;
  490.                try
  491.                {
  492.                   tTweening.onComplete.apply(eventScope,tTweening.onCompleteParams);
  493.                }
  494.                catch(e4:Error)
  495.                {
  496.                   handleError(tTweening,e4,"onComplete");
  497.                }
  498.             }
  499.             return !isOver;
  500.          }
  501.          return true;
  502.       }
  503.       
  504.       public static function setTimeScale(param1:Number) : void
  505.       {
  506.          var _loc2_:Number = NaN;
  507.          var _loc3_:Number = NaN;
  508.          if(isNaN(param1))
  509.          {
  510.             param1 = 1;
  511.          }
  512.          if(param1 < 0.00001)
  513.          {
  514.             param1 = 0.00001;
  515.          }
  516.          if(param1 != _timeScale)
  517.          {
  518.             if(_tweenList != null)
  519.             {
  520.                _loc2_ = 0;
  521.                while(_loc2_ < _tweenList.length)
  522.                {
  523.                   _loc3_ = getCurrentTweeningTime(_tweenList[_loc2_]);
  524.                   _tweenList[_loc2_].timeStart = _loc3_ - (_loc3_ - _tweenList[_loc2_].timeStart) * _timeScale / param1;
  525.                   _tweenList[_loc2_].timeComplete = _loc3_ - (_loc3_ - _tweenList[_loc2_].timeComplete) * _timeScale / param1;
  526.                   if(_tweenList[_loc2_].timePaused != undefined)
  527.                   {
  528.                      _tweenList[_loc2_].timePaused = _loc3_ - (_loc3_ - _tweenList[_loc2_].timePaused) * _timeScale / param1;
  529.                   }
  530.                   _loc2_++;
  531.                }
  532.             }
  533.             _timeScale = param1;
  534.          }
  535.       }
  536.       
  537.       public static function resumeAllTweens() : Boolean
  538.       {
  539.          var _loc1_:Boolean = false;
  540.          var _loc2_:uint = 0;
  541.          if(!Boolean(_tweenList))
  542.          {
  543.             return false;
  544.          }
  545.          _loc1_ = false;
  546.          _loc2_ = 0;
  547.          while(_loc2_ < _tweenList.length)
  548.          {
  549.             resumeTweenByIndex(_loc2_);
  550.             _loc1_ = true;
  551.             _loc2_++;
  552.          }
  553.          return _loc1_;
  554.       }
  555.       
  556.       private static function handleError(param1:TweenListObj, param2:Error, param3:String) : void
  557.       {
  558.          var eventScope:Object = null;
  559.          var pTweening:TweenListObj = param1;
  560.          var pError:Error = param2;
  561.          var pCallBackName:String = param3;
  562.          if(Boolean(pTweening.onError) && pTweening.onError is Function)
  563.          {
  564.             eventScope = Boolean(pTweening.onErrorScope) ? pTweening.onErrorScope : pTweening.scope;
  565.             try
  566.             {
  567.                pTweening.onError.apply(eventScope,[pTweening.scope,pError]);
  568.             }
  569.             catch(metaError:Error)
  570.             {
  571.                printError(String(pTweening.scope) + " raised an error while executing the \'onError\' handler. Original error:\n " + pError.getStackTrace() + "\nonError error: " + metaError.getStackTrace());
  572.             }
  573.          }
  574.          else if(!Boolean(pTweening.onError))
  575.          {
  576.             printError(String(pTweening.scope) + " raised an error while executing the \'" + pCallBackName + "\'handler. \n" + pError.getStackTrace());
  577.          }
  578.       }
  579.       
  580.       private static function startEngine() : void
  581.       {
  582.          _engineExists = true;
  583.          _tweenList = new Array();
  584.          __tweener_controller__ = new MovieClip();
  585.          __tweener_controller__.addEventListener(Event.ENTER_FRAME,Tweener.onEnterFrame);
  586.          _currentTimeFrame = 0;
  587.          updateTime();
  588.       }
  589.       
  590.       public static function removeAllTweens() : Boolean
  591.       {
  592.          var _loc1_:Boolean = false;
  593.          var _loc2_:uint = 0;
  594.          if(!Boolean(_tweenList))
  595.          {
  596.             return false;
  597.          }
  598.          _loc1_ = false;
  599.          _loc2_ = 0;
  600.          while(_loc2_ < _tweenList.length)
  601.          {
  602.             removeTweenByIndex(_loc2_);
  603.             _loc1_ = true;
  604.             _loc2_++;
  605.          }
  606.          return _loc1_;
  607.       }
  608.       
  609.       public static function addTween(param1:Object = null, param2:Object = null) : Boolean
  610.       {
  611.          var _loc3_:Number = NaN;
  612.          var _loc4_:Number = NaN;
  613.          var _loc5_:String = null;
  614.          var _loc6_:Array = null;
  615.          var _loc7_:Object = null;
  616.          var _loc8_:Number = NaN;
  617.          var _loc9_:Number = NaN;
  618.          var _loc10_:Array = null;
  619.          var _loc11_:Object = null;
  620.          var _loc12_:Object = null;
  621.          var _loc13_:Function = null;
  622.          var _loc14_:Object = null;
  623.          var _loc15_:TweenListObj = null;
  624.          var _loc16_:Number = NaN;
  625.          var _loc17_:Array = null;
  626.          var _loc18_:Array = null;
  627.          var _loc19_:Array = null;
  628.          var _loc20_:String = null;
  629.          if(!Boolean(param1))
  630.          {
  631.             return false;
  632.          }
  633.          if(param1 is Array)
  634.          {
  635.             _loc6_ = param1.concat();
  636.          }
  637.          else
  638.          {
  639.             _loc6_ = [param1];
  640.          }
  641.          _loc7_ = TweenListObj.makePropertiesChain(param2);
  642.          if(!_inited)
  643.          {
  644.             init();
  645.          }
  646.          if(!_engineExists || !Boolean(__tweener_controller__))
  647.          {
  648.             startEngine();
  649.          }
  650.          _loc8_ = isNaN(_loc7_.time) ? 0 : Number(_loc7_.time);
  651.          _loc9_ = isNaN(_loc7_.delay) ? 0 : Number(_loc7_.delay);
  652.          _loc10_ = new Array();
  653.          _loc11_ = {
  654.             "time":true,
  655.             "delay":true,
  656.             "useFrames":true,
  657.             "skipUpdates":true,
  658.             "transition":true,
  659.             "transitionParams":true,
  660.             "onStart":true,
  661.             "onUpdate":true,
  662.             "onComplete":true,
  663.             "onOverwrite":true,
  664.             "onError":true,
  665.             "rounded":true,
  666.             "onStartParams":true,
  667.             "onUpdateParams":true,
  668.             "onCompleteParams":true,
  669.             "onOverwriteParams":true,
  670.             "onStartScope":true,
  671.             "onUpdateScope":true,
  672.             "onCompleteScope":true,
  673.             "onOverwriteScope":true,
  674.             "onErrorScope":true
  675.          };
  676.          _loc12_ = new Object();
  677.          for(_loc5_ in _loc7_)
  678.          {
  679.             if(!_loc11_[_loc5_])
  680.             {
  681.                if(_specialPropertySplitterList[_loc5_])
  682.                {
  683.                   _loc17_ = _specialPropertySplitterList[_loc5_].splitValues(_loc7_[_loc5_],_specialPropertySplitterList[_loc5_].parameters);
  684.                   _loc3_ = 0;
  685.                   while(_loc3_ < _loc17_.length)
  686.                   {
  687.                      if(_specialPropertySplitterList[_loc17_[_loc3_].name])
  688.                      {
  689.                         _loc18_ = _specialPropertySplitterList[_loc17_[_loc3_].name].splitValues(_loc17_[_loc3_].value,_specialPropertySplitterList[_loc17_[_loc3_].name].parameters);
  690.                         _loc4_ = 0;
  691.                         while(_loc4_ < _loc18_.length)
  692.                         {
  693.                            _loc10_[_loc18_[_loc4_].name] = {
  694.                               "valueStart":undefined,
  695.                               "valueComplete":_loc18_[_loc4_].value,
  696.                               "arrayIndex":_loc18_[_loc4_].arrayIndex,
  697.                               "isSpecialProperty":false
  698.                            };
  699.                            _loc4_++;
  700.                         }
  701.                      }
  702.                      else
  703.                      {
  704.                         _loc10_[_loc17_[_loc3_].name] = {
  705.                            "valueStart":undefined,
  706.                            "valueComplete":_loc17_[_loc3_].value,
  707.                            "arrayIndex":_loc17_[_loc3_].arrayIndex,
  708.                            "isSpecialProperty":false
  709.                         };
  710.                      }
  711.                      _loc3_++;
  712.                   }
  713.                }
  714.                else if(_specialPropertyModifierList[_loc5_] != undefined)
  715.                {
  716.                   _loc19_ = _specialPropertyModifierList[_loc5_].modifyValues(_loc7_[_loc5_]);
  717.                   _loc3_ = 0;
  718.                   while(_loc3_ < _loc19_.length)
  719.                   {
  720.                      _loc12_[_loc19_[_loc3_].name] = {
  721.                         "modifierParameters":_loc19_[_loc3_].parameters,
  722.                         "modifierFunction":_specialPropertyModifierList[_loc5_].getValue
  723.                      };
  724.                      _loc3_++;
  725.                   }
  726.                }
  727.                else
  728.                {
  729.                   _loc10_[_loc5_] = {
  730.                      "valueStart":undefined,
  731.                      "valueComplete":_loc7_[_loc5_]
  732.                   };
  733.                }
  734.             }
  735.          }
  736.          for(_loc5_ in _loc10_)
  737.          {
  738.             if(_specialPropertyList[_loc5_] != undefined)
  739.             {
  740.                _loc10_[_loc5_].isSpecialProperty = true;
  741.             }
  742.             else if(_loc6_[0][_loc5_] == undefined)
  743.             {
  744.                printError("The property \'" + _loc5_ + "\' doesn\'t seem to be a normal object property of " + String(_loc6_[0]) + " or a registered special property.");
  745.             }
  746.          }
  747.          for(_loc5_ in _loc12_)
  748.          {
  749.             if(_loc10_[_loc5_] != undefined)
  750.             {
  751.                _loc10_[_loc5_].modifierParameters = _loc12_[_loc5_].modifierParameters;
  752.                _loc10_[_loc5_].modifierFunction = _loc12_[_loc5_].modifierFunction;
  753.             }
  754.          }
  755.          if(typeof _loc7_.transition == "string")
  756.          {
  757.             _loc20_ = String(_loc7_.transition.toLowerCase());
  758.             _loc13_ = _transitionList[_loc20_];
  759.          }
  760.          else
  761.          {
  762.             _loc13_ = _loc7_.transition;
  763.          }
  764.          if(!Boolean(_loc13_))
  765.          {
  766.             _loc13_ = _transitionList["easeoutexpo"];
  767.          }
  768.          _loc3_ = 0;
  769.          while(_loc3_ < _loc6_.length)
  770.          {
  771.             _loc14_ = new Object();
  772.             for(_loc5_ in _loc10_)
  773.             {
  774.                _loc14_[_loc5_] = new PropertyInfoObj(_loc10_[_loc5_].valueStart,_loc10_[_loc5_].valueComplete,_loc10_[_loc5_].valueComplete,_loc10_[_loc5_].arrayIndex,{},_loc10_[_loc5_].isSpecialProperty,_loc10_[_loc5_].modifierFunction,_loc10_[_loc5_].modifierParameters);
  775.             }
  776.             if(_loc7_.useFrames == true)
  777.             {
  778.                _loc15_ = new TweenListObj(_loc6_[_loc3_],_currentTimeFrame + _loc9_ / _timeScale,_currentTimeFrame + (_loc9_ + _loc8_) / _timeScale,true,_loc13_,_loc7_.transitionParams);
  779.             }
  780.             else
  781.             {
  782.                _loc15_ = new TweenListObj(_loc6_[_loc3_],_currentTime + _loc9_ * 1000 / _timeScale,_currentTime + (_loc9_ * 1000 + _loc8_ * 1000) / _timeScale,false,_loc13_,_loc7_.transitionParams);
  783.             }
  784.             _loc15_.properties = _loc14_;
  785.             _loc15_.onStart = _loc7_.onStart;
  786.             _loc15_.onUpdate = _loc7_.onUpdate;
  787.             _loc15_.onComplete = _loc7_.onComplete;
  788.             _loc15_.onOverwrite = _loc7_.onOverwrite;
  789.             _loc15_.onError = _loc7_.onError;
  790.             _loc15_.onStartParams = _loc7_.onStartParams;
  791.             _loc15_.onUpdateParams = _loc7_.onUpdateParams;
  792.             _loc15_.onCompleteParams = _loc7_.onCompleteParams;
  793.             _loc15_.onOverwriteParams = _loc7_.onOverwriteParams;
  794.             _loc15_.onStartScope = _loc7_.onStartScope;
  795.             _loc15_.onUpdateScope = _loc7_.onUpdateScope;
  796.             _loc15_.onCompleteScope = _loc7_.onCompleteScope;
  797.             _loc15_.onOverwriteScope = _loc7_.onOverwriteScope;
  798.             _loc15_.onErrorScope = _loc7_.onErrorScope;
  799.             _loc15_.rounded = _loc7_.rounded;
  800.             _loc15_.skipUpdates = _loc7_.skipUpdates;
  801.             removeTweensByTime(_loc15_.scope,_loc15_.properties,_loc15_.timeStart,_loc15_.timeComplete);
  802.             _tweenList.push(_loc15_);
  803.             if(_loc8_ == 0 && _loc9_ == 0)
  804.             {
  805.                _loc16_ = _tweenList.length - 1;
  806.                updateTweenByIndex(_loc16_);
  807.                removeTweenByIndex(_loc16_);
  808.             }
  809.             _loc3_++;
  810.          }
  811.          return true;
  812.       }
  813.       
  814.       public static function registerTransition(param1:String, param2:Function) : void
  815.       {
  816.          if(!_inited)
  817.          {
  818.             init();
  819.          }
  820.          _transitionList[param1] = param2;
  821.       }
  822.       
  823.       public static function printError(param1:String) : void
  824.       {
  825.          trace("## [Tweener] Error: " + param1);
  826.       }
  827.       
  828.       private static function affectTweens(param1:Function, param2:Object, param3:Array) : Boolean
  829.       {
  830.          var _loc4_:Boolean = false;
  831.          var _loc5_:uint = 0;
  832.          var _loc6_:Array = null;
  833.          var _loc7_:uint = 0;
  834.          var _loc8_:uint = 0;
  835.          var _loc9_:uint = 0;
  836.          _loc4_ = false;
  837.          if(!Boolean(_tweenList))
  838.          {
  839.             return false;
  840.          }
  841.          _loc5_ = 0;
  842.          while(_loc5_ < _tweenList.length)
  843.          {
  844.             if(Boolean(_tweenList[_loc5_]) && _tweenList[_loc5_].scope == param2)
  845.             {
  846.                if(param3.length == 0)
  847.                {
  848.                   param1(_loc5_);
  849.                   _loc4_ = true;
  850.                }
  851.                else
  852.                {
  853.                   _loc6_ = new Array();
  854.                   _loc7_ = 0;
  855.                   while(_loc7_ < param3.length)
  856.                   {
  857.                      if(Boolean(_tweenList[_loc5_].properties[param3[_loc7_]]))
  858.                      {
  859.                         _loc6_.push(param3[_loc7_]);
  860.                      }
  861.                      _loc7_++;
  862.                   }
  863.                   if(_loc6_.length > 0)
  864.                   {
  865.                      if((_loc8_ = AuxFunctions.getObjectLength(_tweenList[_loc5_].properties)) == _loc6_.length)
  866.                      {
  867.                         param1(_loc5_);
  868.                         _loc4_ = true;
  869.                      }
  870.                      else
  871.                      {
  872.                         _loc9_ = splitTweens(_loc5_,_loc6_);
  873.                         param1(_loc9_);
  874.                         _loc4_ = true;
  875.                      }
  876.                   }
  877.                }
  878.             }
  879.             _loc5_++;
  880.          }
  881.          return _loc4_;
  882.       }
  883.       
  884.       public static function getTweens(param1:Object) : Array
  885.       {
  886.          var _loc2_:uint = 0;
  887.          var _loc3_:String = null;
  888.          var _loc4_:Array = null;
  889.          if(!Boolean(_tweenList))
  890.          {
  891.             return [];
  892.          }
  893.          _loc4_ = new Array();
  894.          _loc2_ = 0;
  895.          while(_loc2_ < _tweenList.length)
  896.          {
  897.             if(Boolean(_tweenList[_loc2_]) && _tweenList[_loc2_].scope == param1)
  898.             {
  899.                for(_loc3_ in _tweenList[_loc2_].properties)
  900.                {
  901.                   _loc4_.push(_loc3_);
  902.                }
  903.             }
  904.             _loc2_++;
  905.          }
  906.          return _loc4_;
  907.       }
  908.       
  909.       public static function isTweening(param1:Object) : Boolean
  910.       {
  911.          var _loc2_:uint = 0;
  912.          if(!Boolean(_tweenList))
  913.          {
  914.             return false;
  915.          }
  916.          _loc2_ = 0;
  917.          while(_loc2_ < _tweenList.length)
  918.          {
  919.             if(Boolean(_tweenList[_loc2_]) && _tweenList[_loc2_].scope == param1)
  920.             {
  921.                return true;
  922.             }
  923.             _loc2_++;
  924.          }
  925.          return false;
  926.       }
  927.       
  928.       public static function pauseTweenByIndex(param1:Number) : Boolean
  929.       {
  930.          var _loc2_:TweenListObj = null;
  931.          _loc2_ = _tweenList[param1];
  932.          if(_loc2_ == null || _loc2_.isPaused)
  933.          {
  934.             return false;
  935.          }
  936.          _loc2_.timePaused = getCurrentTweeningTime(_loc2_);
  937.          _loc2_.isPaused = true;
  938.          return true;
  939.       }
  940.       
  941.       public static function getCurrentTweeningTime(param1:Object) : Number
  942.       {
  943.          return !!param1.useFrames ? _currentTimeFrame : _currentTime;
  944.       }
  945.       
  946.       public static function getTweenCount(param1:Object) : Number
  947.       {
  948.          var _loc2_:uint = 0;
  949.          var _loc3_:Number = NaN;
  950.          if(!Boolean(_tweenList))
  951.          {
  952.             return 0;
  953.          }
  954.          _loc3_ = 0;
  955.          _loc2_ = 0;
  956.          while(_loc2_ < _tweenList.length)
  957.          {
  958.             if(Boolean(_tweenList[_loc2_]) && _tweenList[_loc2_].scope == param1)
  959.             {
  960.                _loc3_ += AuxFunctions.getObjectLength(_tweenList[_loc2_].properties);
  961.             }
  962.             _loc2_++;
  963.          }
  964.          return _loc3_;
  965.       }
  966.       
  967.       private static function stopEngine() : void
  968.       {
  969.          _engineExists = false;
  970.          _tweenList = null;
  971.          _currentTime = 0;
  972.          _currentTimeFrame = 0;
  973.          __tweener_controller__.removeEventListener(Event.ENTER_FRAME,Tweener.onEnterFrame);
  974.          __tweener_controller__ = null;
  975.       }
  976.       
  977.       public static function removeTweensByTime(param1:Object, param2:Object, param3:Number, param4:Number) : Boolean
  978.       {
  979.          var removed:Boolean = false;
  980.          var removedLocally:Boolean = false;
  981.          var i:uint = 0;
  982.          var tl:uint = 0;
  983.          var pName:String = null;
  984.          var eventScope:Object = null;
  985.          var p_scope:Object = param1;
  986.          var p_properties:Object = param2;
  987.          var p_timeStart:Number = param3;
  988.          var p_timeComplete:Number = param4;
  989.          removed = false;
  990.          tl = _tweenList.length;
  991.          i = 0;
  992.          while(i < tl)
  993.          {
  994.             if(Boolean(_tweenList[i]) && p_scope == _tweenList[i].scope)
  995.             {
  996.                if(p_timeComplete > _tweenList[i].timeStart && p_timeStart < _tweenList[i].timeComplete)
  997.                {
  998.                   removedLocally = false;
  999.                   for(pName in _tweenList[i].properties)
  1000.                   {
  1001.                      if(Boolean(p_properties[pName]))
  1002.                      {
  1003.                         if(Boolean(_tweenList[i].onOverwrite))
  1004.                         {
  1005.                            eventScope = Boolean(_tweenList[i].onOverwriteScope) ? _tweenList[i].onOverwriteScope : _tweenList[i].scope;
  1006.                            try
  1007.                            {
  1008.                               _tweenList[i].onOverwrite.apply(eventScope,_tweenList[i].onOverwriteParams);
  1009.                            }
  1010.                            catch(e:Error)
  1011.                            {
  1012.                               handleError(_tweenList[i],e,"onOverwrite");
  1013.                            }
  1014.                         }
  1015.                         _tweenList[i].properties[pName] = undefined;
  1016.                         delete _tweenList[i].properties[pName];
  1017.                         removedLocally = true;
  1018.                         removed = true;
  1019.                      }
  1020.                   }
  1021.                   if(removedLocally)
  1022.                   {
  1023.                      if(AuxFunctions.getObjectLength(_tweenList[i].properties) == 0)
  1024.                      {
  1025.                         removeTweenByIndex(i);
  1026.                      }
  1027.                   }
  1028.                }
  1029.             }
  1030.             i++;
  1031.          }
  1032.          return removed;
  1033.       }
  1034.       
  1035.       public static function registerSpecialPropertySplitter(param1:String, param2:Function, param3:Array = null) : void
  1036.       {
  1037.          var _loc4_:SpecialPropertySplitter = null;
  1038.          if(!_inited)
  1039.          {
  1040.             init();
  1041.          }
  1042.          _loc4_ = new SpecialPropertySplitter(param2,param3);
  1043.          _specialPropertySplitterList[param1] = _loc4_;
  1044.       }
  1045.       
  1046.       public static function removeTweenByIndex(param1:Number, param2:Boolean = false) : Boolean
  1047.       {
  1048.          _tweenList[param1] = null;
  1049.          if(param2)
  1050.          {
  1051.             _tweenList.splice(param1,1);
  1052.          }
  1053.          return true;
  1054.       }
  1055.       
  1056.       public static function resumeTweens(param1:Object, ... rest) : Boolean
  1057.       {
  1058.          var _loc3_:Array = null;
  1059.          var _loc4_:uint = 0;
  1060.          _loc3_ = new Array();
  1061.          _loc4_ = 0;
  1062.          while(_loc4_ < rest.length)
  1063.          {
  1064.             if(typeof rest[_loc4_] == "string" && _loc3_.indexOf(rest[_loc4_]) == -1)
  1065.             {
  1066.                _loc3_.push(rest[_loc4_]);
  1067.             }
  1068.             _loc4_++;
  1069.          }
  1070.          return affectTweens(resumeTweenByIndex,param1,_loc3_);
  1071.       }
  1072.       
  1073.       public static function pauseTweens(param1:Object, ... rest) : Boolean
  1074.       {
  1075.          var _loc3_:Array = null;
  1076.          var _loc4_:uint = 0;
  1077.          _loc3_ = new Array();
  1078.          _loc4_ = 0;
  1079.          while(_loc4_ < rest.length)
  1080.          {
  1081.             if(typeof rest[_loc4_] == "string" && _loc3_.indexOf(rest[_loc4_]) == -1)
  1082.             {
  1083.                _loc3_.push(rest[_loc4_]);
  1084.             }
  1085.             _loc4_++;
  1086.          }
  1087.          return affectTweens(pauseTweenByIndex,param1,_loc3_);
  1088.       }
  1089.    }
  1090. }
  1091.